package com.combetter.changxing.util;

/**
 * ASC码与字符互相转化
 * <p>
 * 作者: Chen
 * 日期: 2018/11/21 16:10
 */
public class ASCUtils {
    private static int ascNum;
    private static char strChar;

    /**
     * 字符转ASC
     *
     * @param st
     * @return
     */
    public static int getAsc(String st) {
        byte[] gc = st.getBytes();
        ascNum = (int) gc[0];
        return ascNum;
    }


    /**
     * ASC转字符
     *
     * @param backnum
     * @return
     */
    public static char backchar(int backnum) {
        strChar = (char) backnum;
        return strChar;
    }
}
